<template>
  <div className="basic-table">
    <basic-container>
      <el-table
              :data="tableData"
              style="width: 100%">
        <el-table-column
                prop="name"
                label="猎头姓名"
                align="center"
                header-align="center">
            <template slot-scope="scope">
                <el-button type="text" @click="handleRoutePosition(scope.$index, scope.row)">
                    {{scope.row.name}}
                </el-button>
            </template>
        </el-table-column>
        <el-table-column
                prop="mobile"
                label="手机号"
                align="center"
                header-align="center">
        </el-table-column>
        <el-table-column
                prop="resumeNum"
                label="收到简历数"
                align="center"
                sortable
                header-align="center">
        </el-table-column>
        <el-table-column
                prop="pushNum"
                label="创建职位数"
                align="center"
                header-align="center"
                sortable>
        </el-table-column>
        <el-table-column
                prop="successNum"
                label="成功入职数"
                align="center"
                header-align="center"
                sortable>
        </el-table-column>
      </el-table>
    </basic-container>
  </div>
</template>

<script>
    import BasicContainer from '@vue-materials/basic-container'
    import Config from '@myconfig/config.min'
    import axios from 'axios'

    export default {
        components: {BasicContainer},
        name: 'BasicTable',

        data() {
            return {
                tableData: []
            }
        },
        created() {
            this.getData();
        },
        methods: {
            getData() {
                let _this = this;
                axios({
                    method: 'get',
                    url: Config.baseUrl + "/api/user/performance/lietou",
                }).then(function (response) {
                    if (response.data.code != 1) {

                    } else {
                        _this.tableData = response.data.data;
                    }
                })
            },
            handleRoutePosition(index, row) {
                this.$router.push({
                    path: '/myPosition',
                    name: 'myPosition',
                    component: 'MyPosition',
                    params: {
                        routeParam1: row.userId + '/',
                    }
                })
            }
        }

    }
</script>

<style>
  .basic-table {

  }
</style>
